using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace demo_doan
{
    class TinhTrangSach : Interface
    {
        protected int matrinhtrang;
        protected string tentinhtrang;

        public string TenTinhTrang
        {
            get { return tentinhtrang; }
            set { tentinhtrang = value; }
        }
	
        public int MaTinhTrang
        {
            get { return matrinhtrang; }
            set { matrinhtrang = value; }
        }

        public TinhTrangSach() { }
        public TinhTrangSach(int ma, string ten)
        {
            matrinhtrang = ma;
            tentinhtrang = ten;
        }
        public TinhTrangSach(TinhTrangSach tt)
        {
            matrinhtrang = tt.MaTinhTrang;
            tentinhtrang = tt.TenTinhTrang;
        }

        public override void Insert(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void Update(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void Delete(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override DataTable Select(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            return prv.ExecuteQuery(sql);
        }
    }
}
